package com.example.demo.mapper;

import com.example.demo.model.ArticleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ArticleMapper {
    @Select("select articleinfo.*,userinfo.username from articleinfo left join userinfo on articleinfo.uid=userinfo.id")
    List<ArticleInfo> getAll();


    @Select("select * from articleinfo where uid=#{uid}")
    List<ArticleInfo> getListByUid(@Param("uid")Integer uid);

}
